﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace NGDTConsole.Utility
{
    public class CSVFileManager : FileManager
    {
        //manages CSV input and output functions
        public CSVFileManager()
        {
            this.reader = null;
            this.writer = null;
        }

        public CSVFileManager(StreamReader reader, StreamWriter writer)
        {
            this.reader = reader;
            this.writer = writer;
        }

        public CSVFileManager(string inputFile, string outputFile)
        {
            this.reader = new StreamReader(inputFile);
            this.writer = new StreamWriter(outputFile);
        }

        public override void ReadFile(string path)
        {
            //read a file to the content
            FileInfo fileInfo = new FileInfo(path);
            if (fileInfo.Exists)
            {
                FileStream fileStream = fileInfo.OpenRead();
                
            }
            reader = new StreamReader(path);            
            this.content = reader.ReadToEnd();
        }

        public override void WriteToFile(Stream stream)
        {
            throw new NotImplementedException();
        }

        public override void SaveFile(string path)
        {
            throw new NotImplementedException();
        }

        public override void ParseReadContent(string content)
        {
            throw new NotImplementedException();
        }

        public override void Close()
        {
            throw new NotImplementedException();
        }
    }
}
